extends layout

block content
	- var imagelikes = image.likes ? image.likes : 0
	- var viewtimes = image.viewtimes ? image.viewtimes : 0
	.row
		.col-12.col-md-8
			.card
				img.card-img-top(src=`/uploads/${image.diskfilename}` alt=image.title)
				.card-body.d-flex.justify-content-between
					div.inline-block
						p= image.title
						i.fas.fa-eye= " " + viewtimes + "  "
						button.far.fa-thumbs-up#like-btn(data-imageid=image._id, style='border:0;background-color:#ffffff')= " " + imagelikes
		.col-12.col-md-4
			include  includes/stats.pug		
	.row
		.col-12.col-md-8
			.card
				.card-body
					h4.card-title Comments
					form(action=`/comments/${image._id}`, method="post")
						.form-group.row
							label.col-12.col-md-2 E-mail
							input.col-12.col-md-10.form-control(type="email", name="email")
						.form-group.row
							label.col-12.col-md-2 Nickname
							input.col-12.col-md-10.form-control(type="text", name="nickname")
						.form-group.row
							label.col-12.col-md-2 Comment
							textarea.col-12.col-md-10.form-control(rows="5", name="comment")
						.form-group.row
							.col-12.offset-md-8.col-md-4
								button.btn.btn-primary.btn-block(type="submit") Save
	.row
		.col-12.col-md-8
			.row
				each comment in comments
					.col-12
						.card.col-12
							.card-body
								h3.card-title= comment.nickname
								h6.card-subtitle.text-muted= comment.email
								p.card-text= comment.comment

	script(src="/javascripts/show.js")
